<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;


/**
 * App\SkuValue
 *
 * @property int $id
 * @property int $sku_id 规格id
 * @property int $value 规格值
 * @property int $sort 排序
 * @property int $status 状态 0：关闭 1：开启
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue newQuery()
 * @method static \Illuminate\Database\Query\Builder|\App\SkuValue onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue query()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue whereSkuId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue whereSort($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SkuValue whereValue($value)
 * @method static \Illuminate\Database\Query\Builder|\App\SkuValue withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\SkuValue withoutTrashed()
 * @mixin \Eloquent
 */
class SkuValue extends Model
{
    protected $table = "sku_value";
    use SoftDeletes;

    public static function getSkuValueName($id){
        $skuValue = self::whereId($id)->first();
        return $skuValue ? $skuValue->value : '';
    }
}
